package com.smartinput.user.controller

import com.mensanyun.kotool.util.executeQueryWithTry
import com.smartinput.user.application.service.UserService
import com.smartinput.user.application.dto.*
import org.springframework.web.bind.annotation.*

@RestController
@RequestMapping("/api/user")
class UserController(
    private val userService: UserService
) {

    @PostMapping("/register")
    fun register(@RequestBody request: RegisterRequest) = executeQueryWithTry {
        userService.register(request.userName, request.password)
    }

    @GetMapping("/profile")
    fun getProfile() = executeQueryWithTry {
        userService.getCurrentUserProfile()
    }
} 